import { asyncLoadComponent } from '@/routes/asyncLoadComponent'
import {
    UserOutlined,
    UserAddOutlined,
    AuditOutlined,
    ApartmentOutlined,
} from '@ant-design/icons';
import { permissionCodes as codes } from '../permission'
let route = {
    path: '/userCenter',
    exact: false,
    auth: true,
    index: 1,
    component: asyncLoadComponent(() => import('@/pages/userCenter')),
    meta: {
        title: '用户中心',
        roles: [codes.user.manage],
        icon: <UserOutlined />
    },
    routes: [{
        path: '/userCenter/roleManage',
        exact: true,
        auth: true,
        index: 11,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/roleManage/index')),
        meta: {
            title: '角色管理',
            roles: [codes.role.list],
            icon: <AuditOutlined />
        },
    },
    {
        path: '/userCenter/access',
        exact: true,
        auth: true,
        index: 12,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/roleManage/access')),
        meta: {
            title: '权限分配',
            hideInMenu: true,
            roles: [codes.role.authority],
            // roles: ['role_authority'],
            icon: <AuditOutlined />
        },
    },
    {
        path: '/userCenter/userManage',
        exact: true,
        index: 13,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/userManage/index')),
        auth: true,
        meta: {
            title: '用户管理',
            roles: [codes.user.list],
            icon: <UserAddOutlined />
        },
    },
    {
        path: '/userCenter/departManage',
        exact: true,
        auth: true,
        index: 14,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/departManage/index')),
        meta: {
            title: '部门管理',
            roles: [codes.dept.tree],
            icon: <ApartmentOutlined />
        },
    },
    {
        path: '/userCenter/userInfo',
        exact: true,
        auth: true,
        index: 15,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/userManage/userInfo')),
        meta: {
            title: '个人信息',
            hideInMenu: true,
            roles: [codes.user_center],
            icon: <UserAddOutlined />
        }
    },
    {
        path: '/userCenter/add',
        exact: true,
        auth: true,
        index: 16,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/userManage/edit')),
        meta: {
            title: '新增用户',
            hideInMenu: true,
            roles: [codes.user.add],
            icon: <UserAddOutlined />
        }
    },
    {
        path: '/userCenter/edit',
        exact: true,
        auth: true,
        index: 17,
        pIndex: 1,
        component: asyncLoadComponent(() => import('@/pages/userCenter/userManage/edit')),
        meta: {
            title: '编辑用户',
            hideInMenu: true,
            roles: [codes.user.edit],
            icon: <UserAddOutlined />
        }
    }]
}
export default route